package nl.infodation.emr.psrefdata.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="commercialreferencestype")
public class CommercialReferences implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "primaryKey")
	@GeneratedValue(strategy=GenerationType.AUTO)
	private long primaryKey;

	@Column(name = "code")
	private String refcoId;
	
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
	@JoinColumn(name="OfferType_fk", referencedColumnName="primaryKey")
	private Offer offer;
	
	public Offer getOffer() {
		return offer;
	}

	public void setOffer(Offer offer) {
		this.offer = offer;
	}

	public long getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(long primaryKey) {
		this.primaryKey = primaryKey;
	}

	public String getRefcoId() {
		return refcoId;
	}

	public void setRefcoId(String refcoId) {
		this.refcoId = refcoId;
	}
	
}
